﻿<UserControl x:Class="UserInterface.Demo"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
             xmlns:UserInterface="clr-namespace:UserInterface"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">

    <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
        <StackPanel Orientation="Vertical">
            <TextBlock Text="Current Time" />
            <TextBlock Text="{Binding CurrentTime}" />
            <TextBlock Text="{Binding CurrentSecondType}" />
            <TextBlock Text="Add Alarm" Margin="0,10,0,0" />
            <xctk:TimePicker Name="NewAlarmTime" Kind="Local" TimeInterval="00:30:00" StartTime="{Binding AlarmTimePickerStartTime}"/>
            <Button Command="{Binding AddAlarmCommand}" CommandParameter="{Binding Value, ElementName=NewAlarmTime}" Content="Add" />

            <TextBlock Text="Add text items and enter text into them" Margin="0,50,0,20" />
            <Button Content="Add Text Item" Command="{Binding AddTextItemCommand}" />
            <ItemsControl ItemsSource="{Binding TextItems}">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <UserInterface:TextItem />
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
            <TextBlock Text="Number of text items containing the letter 'a':" />
            <TextBlock Text="{Binding NumberOfTextItemsContainingLetterA}" />
            <TextBlock Text="Items containing the letter 'a':" />
            <TextBlock Text="{Binding ItemsContainingLetterAAsStringAlt}" />

            <TextBlock Text="DemoAltViewModel" FontWeight="Bold" Margin="0,8,0,4" />
            <TextBlock Text="Current Time" />
            <TextBlock Text="{Binding Alt.CurrentTime}" />
            <TextBlock Text="{Binding Alt.CurrentSecondType}" />

            <TextBlock Text="DemoAlt2ViewModel" FontWeight="Bold" Margin="0,8,0,4" />
            <TextBlock Text="Current Time" />
            <TextBlock Text="{Binding Alt2.CurrentTime}" />
            <TextBlock Text="{Binding Alt2.CurrentSecondType}" />

        </StackPanel>
    </ScrollViewer>
</UserControl>
